<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AddSliderAndVajra extends Migrator
{
    public function up()
    {
        $sql = <<<SQL
ALTER TABLE `takeout_slider`
ADD COLUMN `type`  tinyint(1) NOT NULL DEFAULT 1 COMMENT '1.外卖2.聚合模板';
SQL;
        $this->execute($sql);
        $sql = <<<SQL
ALTER TABLE `takeout_vajra`
ADD COLUMN `type`  tinyint(1) NOT NULL DEFAULT 1 COMMENT '1.外卖2.聚合模板';
SQL;
        $this->execute($sql);
    }

    public function down()
    {
        $this->table('takeout_slider')->removeColumn('type');
        $this->table('takeout_vajra')->removeColumn('type');
    }
}
